<html>
<head>
<title>firstworks   Installing SQL Relay</title>
<link href="css/styles.css" rel="stylesheet">
</head>
<body>

<span class="heading1">Installing SQL Relay</span><br><br>

<ul>
<li><a href="#prerequisites">Prerequisites</a>
<li><a href="#downloading">Downloading SQL Relay</a>
<li><a href="#unpacking">Unpacking SQL Relay</a>
<li><a href="#compiling">Compiling SQL Relay</a>
<li><a href="#installing">Installing SQL Relay</a>
<li><a href="#rpms">Installing SQL Relay RPMS</a>
</ul>

<a name="prerequisites"></a>
<span class="heading2">Prerequisites:</span><br><br>

<p>Before you can compile <b>SQL Relay</b>, you will need to install some
pre-requisites.</p>

<p>The <b>Rudiments</b> library is essential.  It's available
from <a target="_top" href="http://www.firstworks.com">www.firstworks.com</a>
</p>

<p>If you want to build the non-C/C++ API's, you need one or more of
<a href="http://www.perl.org">Perl</a>, 
<a href="http://www.php.org">PHP</a>,
<a href="http://www.python.org">Python</a>,
<a href="http://www.ruby-lang.org">Ruby</a>,
<a href="http://tcl.sourceforge.net">TCL</a>,
<a href="http://java.sun.com">Java</a> (see note) or
<a href="http://www.zope.org">Zope</a>.

<p>(note: The GNU gcj compiler appears to be sufficient to compile the SQL Relay
Java API and SQL Relay's configure script will detect it and use it if it's
available.  But the GNU gij JVM appears to currently have a bug preventing
programs which use the SQL Relay Java API from working in some cases.
Specifically, if a method which should return a String returns a null,
the gij JVM throws a NullPointerException.  The GNU gij JVM exhibits this
behavior with code compiled with either the GNU cgj compiler or non-GNU javac
compilers.  And non-GNU JVM's successfully run code generated by either the GNU
gcj compiler or non-GNU javac compilers.)</p>

<p>To build the database connection daemons, you'll need one or more of
<a target="_top" href="http://www.oracle.com">Oracle</a>
(Version 7.3.x, 8.x, 9.x or 10.x),
<a target="_top" href="http://web.mysql.com">MySQL</a>, 
<a target="_top" href="http://www.postgresql.org">PostgreSQL</a>, 
<a target="_top" href="http://www.sqlite.org">SQLite</a>,
<a target="_top" href="http://www.unixodbc.org">unixODBC</a>,
<a target="_top" href="http://www.iodbc.org">iODBC</a>,
<a target="_top" href="http://www.ibm.com/software/data/db2/">DB2</a>,
<a target="_top" href="http://www.firebirdsql.com/">Firebird</a>,
<a target="_top" href="http://www.sybase.com">Sybase</a> or
<a target="_top" href="http://www.freetds.org">FreeTDS</a> (for
accessing either
<a target="_top" href="http://www.sybase.com">Sybase</a> or
<a target="_top" href="http://www.microsof.com/sql/default.html">MS SQL Server</a>),
<a target="_top" href="http://mdbtools.sourceforge.net">MDB Tools</a> for accessing MS Access Databases.

<a name="downloading"></a>
<span class="heading2">Downloading SQL Relay:</span><br><br>
<p>You can download the most current source distribution of <b>SQL Relay</b> 
from <a href="http://www.firstworks.com">www.firstworks.com</a>.</p>

<a name="unpacking"></a>
<span class="heading2">Unpacking SQL Relay:</span><br><br>

<p>To unpack the distribution, copy the file to a location on your machine
that you have access to and execute the following commands:</p>

<blockquote><b>
gunzip sqlrelay-X.XX.tar.gz<br>
tar xf sqlrelay-X.XX.tar
</b></blockquote>

<p>This will create a sqlrelay-X.XX directory. Change directories into that 
directory.</p>

<a name="compiling"></a>
<span class="heading2">Compiling SQL Relay:</span><br><br>


<p>To compile <b>SQL Relay</b>, make sure your ORACLE_HOME environment variable
is set if you want to include support for Oracle and type:</p>

<blockquote><b>
configure<br>
make
</b></blockquote>

<p>The configure script takes lots of command line options, most of which
tell it where to find prerequisite software in case any of it is
installed in non-standard locations.  It also takes the --prefix option
in case you want to install <b>SQL Relay</b> somewhere other than
/usr/local/firstworks.  You can run "configure --help" to get a list of
command line options. For example:</p>

<blockquote><b>
configure --prefix=/usr/local
</b></blockquote>

<p>This invocation would cause the libraries to be installed in
/usr/local/lib, the header files in /usr/local/include, the binaries
and scripts to be installed in /usr/local/bin, etc.</p>

<a name="installing"></a>
<span class="heading2">Installing SQL Relay:</span><br><br>

<p>To install <b>SQL Relay</b> become superuser and type:</p>

<blockquote><b>
make install
</b></blockquote>

<p>Libraries are installed in /usr/local/firstworks/lib.  Include files
are installed in /usr/local/firstworks/include.  Binaries and scripts
are installed in /usr/local/firstworks/bin.  An example config file is
installed in /usr/local/firstworks/etc.  Java libraries are installed
in /usr/local/firstworks/java.  Python, Perl, PHP, Ruby and TCL files
are installed in the appropriate language-specific directories.</p>
	
<p>If you install <b>SQL Relay</b> as root, init scripts and files will be
installed in the appropriate places under /etc for your system.  If you
install <b>SQL Relay</b> as a non-root user, the init scripts and files will
be installed in similar places under /usr/local/firstworks/etc.</p>

<p>To uninstall <b>SQL Relay</b> become superuser and type:</p>

<blockquote><b>
make uninstall
</b></blockquote>


<a name="rpms"></a>
<span class="heading2">Installing SQL Relay RPMS:</span><br><br>

<p>If your system supports RedHat Package Manager RPM version 4.0.3 or
greater then you can build RPMS by running the following command
against the distribution tarball:</p>

<blockquote><b>
<p>rpm -ta sqlrelay-xxx.tar.gz</p>
<p>(where xxx is replaced with the version number)</p>
</b></blockquote>

<p>You can instruct the build process not to build certain modules by
giving it one of the following flags:</p>

<blockquote><b>
-without db2<br>
-without freetds<br>
-without firebird<br>
-without mysql<br>
-without odbc<br>
-without oracle<br>
-without postgresql<br>
-without sqlite<br>
-without sybase<br>
-without mdbtools<br>
-without perl<br>
-without python<br>
-without php<br>
-without tcl<br>
-without java<br>
-without zope<br>
</b></blockquote>

<p>For example, if you want to build everything but the oracle and zope
modules, then you would run the following command:</p>

<blockquote><b>
<p>rpm -ta -without oracle -without zope sqlrelay-xxx.tar.gz</p>
<p>(where xxx is replaced with the version number)</p>
</b></blockquote>

<p>This will generate RPM's in the system-wide RPM directory (usually
/usr/src/redhat/RPMS or /usr/local/rpm/RPMS) under the subdirectory
corresponding to your system architecture.  You can install them by
changing directories into that directory and executing the following
command as root:</p>

<blockquote><b>
rpm -i --nodeps sqlrelay-*
</b><blockquote>

</body>
</html>
